import createAxios from '/@/utils/axios'

// 岗位管理相关API
export function getPositionList(params: object = {}) {
    return createAxios({
        url: 'admin/yxerp.position/index',
        method: 'get',
        params: params
    })
}

export function getPositionsByDepartment(params: { department_id: number }) {
    return createAxios({
        url: 'admin/yxerp.position/getPositionsByDepartment',
        method: 'get',
        params: params
    })
}

export function addPosition(data: object) {
    return createAxios({
        url: 'admin/yxerp.position/add',
        method: 'post',
        data: data
    })
}

export function updatePosition(data: { row: object, ids: number }) {
    return createAxios({
        url: 'admin/yxerp.position/edit',
        method: 'post',
        data: data
    })
}

export function delPosition(data: { ids: number }) {
    return createAxios({
        url: 'admin/yxerp.position/del',
        method: 'post',
        data: data
    })
} 